package org.code.mallspringboot.service.impl;

import org.code.mallspringboot.dto.PmsBrandDto;
import org.code.mallspringboot.mapper.PmsBrandMapper;
import org.code.mallspringboot.pojo.PmsBrand;
import org.code.mallspringboot.service.PmsBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PmsBrandServiceImpl implements PmsBrandService {

    @Autowired
    private PmsBrandMapper pmsBrandMapper;

    @Override
    public List<PmsBrand> selectPage(String keyword,int pageNum, int pageSize) {
        return pmsBrandMapper.selectPage(keyword,(pageNum - 1) * pageSize, pageSize);
    }

    @Override
    public int total(String keyword) {
        return pmsBrandMapper.total(keyword);
    }

    @Override
    public PmsBrand getBrand(int id) {
        return pmsBrandMapper.getBrand(id);
    }

    @Override
    public int update(PmsBrandDto pmsBrandDto) {
        return pmsBrandMapper.update(pmsBrandDto);
    }

    @Override
    public int add(PmsBrandDto pmsBrandDto) {
        return pmsBrandMapper.add(pmsBrandDto);
    }

    @Override
    public int delete(int id) {
        return pmsBrandMapper.delete(id);
    }

    @Override
    public int update_status(int id, int status) {
        return pmsBrandMapper.update_status(id, status);
    }
}
